#
# Tencent is pleased to support the open source community by making
# MMKV available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of
# the License at
#
#       https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.4.1)


set(can_use_assembler TRUE)
enable_language(ASM)
IF("${OHOS_ARCH}" STREQUAL "arm64-v8a")
 SET(ASM_OPTIONS "-x assembler-with-cpp")
 SET(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS} -march=armv8+crypto -D__OHOS__")
ENDIF()



project(pahomqtt)

# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.

add_library(pahomqtt

        # Sets the library as a shared library.
        STATIC

        # Provides a relative path to your source file(s).
        Thread.c
        Heap.c
        SSLSocket.c
        MQTTPacket.c
        OsWrapper.c
        MQTTAsync.c
        MQTTProtocolOut.c
        Clients.c
        MQTTPacketOut.c
        MQTTPersistenceDefault.c
        WebSocket.c
        MQTTPersistence.c
        Log.c
        MQTTProperties.c
        Messages.c
        StackTrace.c
        LinkedList.c
        Base64.c
        MQTTTime.c
        MQTTReasonCodes.c
        MQTTAsyncUtils.c
        SHA1.c
        Socket.c
        MQTTVersion.c
        MQTTProtocolClient.c
        SocketBuffer.c
        Tree.c
        utf-8.c
        memcpy_s.c
        memset_s.c
        securecutil.c
        )

target_include_directories(pahomqtt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})



target_link_libraries(pahomqtt libc++.a libhilog_ndk.z.so)


